package com.nutiteq.multistored;

import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;
import javax.microedition.midlet.MIDletStateChangeException;

import com.nutiteq.log.Log;

public class MultiStoredSample extends MIDlet {
  private MultiStoredCanvas canvas;
  public static MultiStoredSample instance;

  public MultiStoredSample() {
    instance = this;
  }

  protected void startApp() throws MIDletStateChangeException {
    Log.enableAll();
    if (canvas == null) {
      canvas = new MultiStoredCanvas();
      canvas.initialize();
    }

    Display.getDisplay(this).setCurrent(canvas);
  }

  protected void destroyApp(final boolean b) throws MIDletStateChangeException {
    canvas.deinitialize();
    notifyDestroyed();
  }

  protected void pauseApp() {
  }
}
